
TARGET = hello

CC = gcc
RM = rm -rf

CFLAGS += -c -Wall
LDFLAGS += -lSDL

SOURCES = $(wildcard *.c)
OBJS = $(patsubst %.c, %.o, $(SOURCES))

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) -o $@ $^ $(LDFLAGS)

%.o: %.c
	$(CC) -o $@ $(CFLAGS) $^

clean:
	$(RM) $(TARGET) $(OBJS)

run: $(TARGET)
	./$^

.PHONY: all clean run

